﻿@namespace MudBlazor
@inherits MudComponentBase

<div @attributes="UserAttributes" class="@Classname" style="@Style">
    <div class="mud-input-control-input-container">
        @InputContent
        @if (!String.IsNullOrEmpty(Label))
        {
            <MudInputLabel Class="mud-input-label-inputcontrol" Variant="@Variant" Disabled=@Disabled Error="@Error" Margin="@Margin">
                @Label
            </MudInputLabel>
        }
    </div>
    @if (Error || !String.IsNullOrEmpty(HelperText) || !String.IsNullOrEmpty(CounterText))
    {
        <div class="@HelperContainer">
            <p class="@HelperClass">
                <div class="d-flex">
                    @if (Error)
                    {
                        <div class="mr-auto">
                            @ErrorText
                        </div>
                    }
                    else if (!String.IsNullOrEmpty(HelperText))
                    {
                        <div class="mr-auto">
                            @HelperText
                        </div>
                    }
                    @if (!String.IsNullOrEmpty(CounterText))
                    {
                        <div class="ml-auto">
                            @CounterText
                        </div>            
                    }
                </div>
            </p>
        </div>
    }
    @ChildContent
</div>